<template>
  <van-nav-bar :fixed=true @click-left="onClickLeft"  @click-right="onClickRight">
    <label id="navbar-title" style="font-family:cursive" slot="title">{{ txt }}</label>
    <van-icon id="navbar-title" :name="leftName" size="150%" slot="left"></van-icon>
    <van-icon id="navbar-title" name="more-o" size="150%" slot="right"/>
  </van-nav-bar>
</template>
<script>

import { Toast } from "vant";
export default {
  name: "NavBar",
  props: {
    /** 导航栏标题 */
    txt: String,
    /** 导航栏左侧图标 */
    leftName: String
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1); //返回上一层
    },
    onClickRight() {
      Toast("更多");
    }
  }
};
</script>


